Skip to content

GH-50508: [C++] Support scalar values in AppendScalars - #50584

Merged
pitrou merged 5 commits into
apache:mainfrom
Moemenmohamed24:GH-50508-append-scalars
Jul 27, 2026
Merged

GH-50508: [C++] Support scalar values in AppendScalars#50584
pitrou merged 5 commits into
apache:mainfrom
Moemenmohamed24:GH-50508-append-scalars

Conversation

@Moemenmohamed24

@Moemenmohamed24 Moemenmohamed24 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

RunEndEncodedBuilder::AppendScalar accepts regular scalar values, such as float32 directly. However, RunEndEncodedBuilder::AppendScalars only handled RunEndEncodedScalar values.

This made the two APIs inconsistent. This PR updates AppendScalars to support regular scalar values consistently with AppendScalar.

What changes are included in this PR?

  • Updated RunEndEncodedBuilder::AppendScalars to process each scalar through AppendScalar.
  • Added tests covering regular scalar values and nested RunEndEncodedScalar values.
  • Added tests verifying the expected run ends and values.

Are these changes tested?

Yes. The relevant Run-End Encoded tests pass successfully.

Are there any user-facing changes?

Yes. RunEndEncodedBuilder::AppendScalars now accepts regular scalar values, such as float32, consistently with AppendScalar.

Breaking changes

No

Critical Fix

No.

@Moemenmohamed24
Moemenmohamed24 requested a review from pitrou as a code owner July 21, 2026 21:56
@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #50508 has been automatically assigned in GitHub to PR creator.

@kou kou changed the title GH-50508: Support scalar values in AppendScalars GH-50508: [C++] Support scalar values in AppendScalars Jul 22, 2026
@kou
kou marked this pull request as draft July 22, 2026 00:14
@kou

kou commented Jul 22, 2026

Copy link
Copy Markdown
Member

Could you use our PR template and fix CI failures?
You can make this PR "ready for review" after them.

@Moemenmohamed24

Copy link
Copy Markdown
Contributor Author

Could you use our PR template and fix CI failures? You can make this PR "ready for review" after them.

Done. I updated the PR description using the project template and applied the required clang-format changes. The latest commit has been pushed, and the CI workflows are currently awaiting maintainer approval.

@kou

kou commented Jul 22, 2026

Copy link
Copy Markdown
Member

Approved.

FYI: You can check CI results on your fork by enabling GitHub Actions on your fork.

@kou

kou commented Jul 22, 2026

Copy link
Copy Markdown
Member

Done. I updated the PR description using the project template

It seems that the PR description isn't updated yet...

@Moemenmohamed24
Moemenmohamed24 marked this pull request as ready for review July 22, 2026 03:58
Comment thread cpp/src/arrow/array/array_run_end_test.cc
Comment thread cpp/src/arrow/array/array_run_end_test.cc
UpdateDimensions(committed_logical_length_, 0);
return Status::OK();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTOH, let's please keep an empty line between function and method definitions.

@pitrou

pitrou commented Jul 22, 2026

Copy link
Copy Markdown
Member

I've separately created #50596 to refactor the AppendScalar implementation as its architecture is currently very odd.

@github-actions github-actions Bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jul 22, 2026
@Moemenmohamed24

Copy link
Copy Markdown
Contributor Author

I've separately created #50596 to refactor the AppendScalar implementation as its architecture is currently very odd.

Done. I addressed the review comments.

@Moemenmohamed24

Moemenmohamed24 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

I've separately created #50596 to refactor the AppendScalar implementation as its architecture is currently very odd.

Done. I addressed the review comments.
Thanks for the clarification. I'll keep this PR focused on #50508.

ASSERT_OK_AND_ASSIGN(logical_run_ends, ree_slice->LogicalRunEnds(pool));
ASSERT_ARRAYS_EQUAL(*logical_run_ends, *expected_run_ends);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you restore this empty line?

Comment thread cpp/src/arrow/array/array_run_end_test.cc
Comment thread cpp/src/arrow/array/array_run_end_test.cc
@Moemenmohamed24
Moemenmohamed24 requested a review from pitrou July 27, 2026 04:08
@Moemenmohamed24

Copy link
Copy Markdown
Contributor Author

Hi @pitrou , I have addressed the latest review comments, and all CI checks are passing. The PR is ready for review. Thanks!

@pitrou pitrou left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, thank you @Moemenmohamed24

@pitrou
pitrou merged commit 9c37a70 into apache:main Jul 27, 2026
59 checks passed
@pitrou pitrou removed the awaiting committer review Awaiting committer review label Jul 27, 2026
@conbench-apache-arrow

Copy link
Copy Markdown

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 9c37a70.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants